﻿@model NB.MGJ.Common.Utility.LogOnUserModel
@using NB.MGJ.Common.Helper;
@using NB.MGJ.Common.Utility;
@{
    var _logonUser = SessionHelper.LogOnUser<LogOnUserModel>();
}




<style>
    #picker{
        position:relative;
    }
        #picker .webuploader-element-invisible {
            position: absolute;
            top:0;
            left:0;
            opacity:0;
            width:100%;
            height:100%;
            z-index:9999;

        }




</style>
<nav class="site-navbar navbar navbar-default navbar-fixed-top navbar-inverse " role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle hamburger hamburger-close navbar-toggle-left hided"
                data-toggle="menubar">
            <span class="sr-only">切换菜单</span> <span class="hamburger-bar"></span>
        </button>
        <button type="button" class="navbar-toggle collapsed" data-target="#admui-navbarCollapse"
                data-toggle="collapse">
            <i class="icon wb-more-horizontal" aria-hidden="true"></i>
        </button>
        <div class="navbar-brand navbar-brand-center site-gridmenu-toggle" data-toggle="gridmenu">
            <a href=" ">
                
                @if (!string.IsNullOrEmpty(_logonUser.OrganizationLogo))
                {
                    <img class="navbar-brand-logo visible-lg visible-xs navbar-logo"
                         style=" margin:0;padding:0; margin-left:-14px;margin-top:-16px; width:200px; height:53px;"
                         src="@_logonUser.OrganizationLogo" title="码管家.云系统">
 
                }
                else
                {
                    <img class="navbar-brand-logo visible-lg visible-xs navbar-logo"
                    style=" margin:0;padding:0; margin-left:-14px;margin-top:-16px; width:200px; height:53px;"
                    src="~/Content/HomePage/home/NB-LOGO(1).png" title="码管家.云系统">
                }

            </a>
            <a href=" ">
                <img class="navbar-brand-logo hidden-xs hidden-lg navbar-logo-mini" src="~/Content/HomePage/home/logo-white-mini.png"
                     style="height:50px;margin-top:-13px" title="Admui">
            </a>
        </div>
    </div>
    <div class="navbar-container container-fluid">
        <div class="collapse navbar-collapse navbar-collapse-toolbar" id="admui-navbarCollapse">
            <ul class="nav navbar-toolbar navbar-left">
                <li class="hidden-float" onclick="MenuBarClick()">
                    <a data-toggle="menubar" class="glyphicon glyphicon-resize-horizontal" style="font-size:20px;" href="javascript:;" role="button"
                       id="admui-toggleMenubar">
                        @*<i class="icon hamburger hamburger-arrow-left">
                                <span class="sr-only">切换目录</span>
                                <span class="hamburger-bar"></span>
                            </i>*@
                    </a>
                </li>
                <li class="navbar-menu nav-tabs-horizontal nav-tabs-animate is-load" id="admui-navMenu">
                    <ul class="nav navbar-toolbar nav-tabs" role="tablist">
                        <!-- 顶部菜单 -->

                        <li role="presentation" class="active" onclick="sessionStorage.removeItem('SiteMenuSubIndex'); sessionStorage.removeItem('MenuActivityIndex');">
                            <a href=" ">
                                <i class="glyphicon glyphicon-briefcase"></i> <span>主页</span>
                            </a>
                        </li>

                        @*<li role="presentation" class="">
                            <a data-toggle="tab" href="#admui-navTabsItem-2" aria-controls="admui-navTabsItem-2"
                               role="tab" aria-expanded="false">
                                <i class="glyphicon glyphicon-blackboard"></i> <span>系统菜单</span>
                            </a>
                        </li>*@

                        @*<li role="presentation" class="">
                            <a data-toggle="tab" onclick="$.MGJ.Common.loadurl(this, '/UseHelp/Index')" aria-controls="admui-navTabsItem-3"
                               role="tab" aria-expanded="false">
                                <i class="glyphicon glyphicon-th"></i> <span class="site-menu-title">使用帮助</span>
                            </a>
                        </li>*@

                        <li role="presentation" class="">
                            <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2355780765&site=qq&menu=yes">
                                <i class="glyphicon glyphicon-comment"></i> <span>在线咨询</span>
                            </a>
                        </li>

                        @*<li role="presentation" class="">
                            <a data-toggle="tab" href="#admui-navTabsItem-5" aria-controls="admui-navTabsItem-5"
                               role="tab" aria-expanded="false">
                                <i class="glyphicon glyphicon-wrench"></i> <span>系统设置</span>
                            </a>
                        </li>*@
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-toolbar navbar-right navbar-toolbar-right">
                <li class="dropdown" id="admui-navbarMessage">
                    <a data-toggle="dropdown" href="javascript:;" class="msg-btn" aria-expanded="true" data-animation="scale-up" role="button">
                        <i class="glyphicon glyphicon-bell" aria-hidden="true"></i>
                        <span class="badge badge-danger up msg-num" id="messageCount"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-right dropdown-menu-media" role="menu">
                        <li class="dropdown-menu-header" role="presentation">
                            <h5>最新消息</h5>
                            <span class="label label-round label-danger"></span>
                        </li>
                        <li class="list-group" role="presentation">
                            <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 220px;">
                                <div class="navbar-message-content" id="admui-messageContent" data-height="220px" data-plugin="slimScroll" style="overflow: auto; width: auto; height: 220px;">
                                   
                                </div><div class="slimScrollBar" style="background: rgb(118, 131, 143); width: 4px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 4px; z-index: 99; right: 1px; height: 138.286px;"></div><div class="slimScrollRail" style="width: 4px; height: 100%; position: absolute; top: 0px; border-radius: 4px; background: rgb(204, 213, 219); opacity: 0.1; z-index: 90; right: 1px; display: none;"></div>
                            </div>

                        </li>
                        <li class="dropdown-menu-footer" role="presentation" onclick="$.MGJ.Common.loadurl(this,'@Url.Action("LogManage", "Manager")')">
                            <a href="javascript:void(0)">
                                <i class="glyphicon glyphicon-info-sign"></i><span class="site-menu-title"> 所有消息</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="hidden-xs dropdown" id="admui-navbarDisplay" data-toggle="tooltip" data-placement="bottom"
                    title="设置主题与布局等">
                    <a data-toggle="dropdown" href="javascript:;" aria-expanded="true" data-animation="scale-up" role="button">
                        <i class="glyphicon glyphicon-credit-card" aria-hidden="true"></i>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right dropdown-menu-media animation-scale-up"
                         id="nav_layout">
                        <div id="nav_layout_title">选择列表颜色</div>
                        <ul class="dropdown-menu-header nav_layout dropdown-menu-header new-row" id="nav_layout_body" style="padding-left:0">
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                            <li class="col-xs-2	col-sm-2 col-md-2 col-lg-2 nav-change-color">
                                <a></a>
                            </li>
                        </ul>
                    </div>
                </li>
                @*<li class="hidden-xs" id="admui-QRcode" data-toggle="tooltip" data-placement="bottom" title="在手机上预览本页">
                    <a class="glyphicon glyphicon-phone" href="#" data-toggle="modal" data-target="#admui-mobileView">
                        <span class="sr-only">在手机上预览</span>
                    </a>
                </li>*@
                <li class="hidden-xs" id="admui-navbarFullscreen" data-toggle="tooltip" data-placement="bottom"
                    title="全屏">
                    <a class="glyphicon glyphicon-fullscreen" data-toggle="fullscreen" href="#" role="button">
                        <span class="sr-only">全屏</span>
                    </a>
                </li>
                <li id="head_portrait_li" class="" style="height:60px">

                    <a data-toggle="dropdown" href="javascript:;" id="head_portrait_a" style=" float:left;" aria-expanded="true" data-animation="scale-up" role="button">

                        <img src="@_logonUser.UserImg" id="head_portrait_label_show">
                        <span style=" color: white; float: right; line-height: 20px; margin-left: 5px; margin-top: 18px;">@_logonUser.LoginName@*<br />@_logonUser.RoleID*@</span>
                    </a>

                    <ul class="dropdown-menu dropdown-menu-right dropdown-menu-media animation-scale-up"
                        id="head_portrait_layer">
                        <li>
                            <label id="picker"  style="cursor:pointer">
                                <img id="head_portrait_label" src="~/Content/HomePage/home/head_portrait.png" style="display: block;margin-left: 25px;" />
                                <span>点击更换头像</span>
                            </label>
                            @*<input id="head_portrait" type="file" onchange="change_file()" />*@
                        </li>
                        <li class="no_head" onclick="UpdataMyPWD()">
                            <a>
                                <span>修改密码</span>
                                <span class="glyphicon glyphicon-pencil"></span>
                                <span class="sr-only">修改密码</span>
                            </a>
                        </li>
                        <li class="no_head" title="退出" onclick="sessionStorage.removeItem('SiteMenuSubIndex'); sessionStorage.removeItem('MenuActivityIndex');">
                            <a id="admui-signOut" data-user="9" href="/Home/Index" role="button">
                                <span>退出登陆</span>
                                <span class="glyphicon glyphicon-off"></span>
                                <span class="sr-only">退出</span>
                            </a>
                        </li>
                    </ul>


                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="modal fade" id="admui-mobileView" aria-hidden="true" aria-labelledby="admui-mobileView" role="dialog"
     tabindex="-1">
    <div class="modal-dialog modal-sidebar modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="关闭">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">手机端正在构建,敬请期待。</h4>
            </div>

        </div>
    </div>
</div>
@*<script src="~/Scripts/WebUploader/webuploader.js"></script>*@
<script src="~/Scripts/WebUploader/webuploader.min.js"></script>
<script>
    var uploader = WebUploader.create({

        // 文件接收服务端。
        server: '/DBH/UploadImgToOSS_DataName',

        // 选择文件的按钮。可选。
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: {
            id: '#picker',
            multiple: false
        },
        accept: {
            title: 'Images',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/jpg,image/jpeg,image/png'
        },

        // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
        resize: false
    });
 
    // 当有文件添加进来的时候
    uploader.on('fileQueued', function (file) {
        uploader.upload();
      
    });
    // 文件上传过程中创建进度条实时显示。
    uploader.on('uploadProgress', function (file, percentage) {
      
    });

    // 文件上传成功，给item添加成功class, 用样式标记上传成功。
    uploader.on('uploadSuccess', function (file, response) {
        $('#head_portrait_label').attr('src', response._raw);
        $('#head_portrait_label_show').attr('src', response._raw);
        $.ajax({
            type: "post",
            url: '/Manager/EditUserInfo',
            data: { ID: "@_logonUser.UserID",UserImg: response._raw },
            success: function (data) {  }
        });
     
    });

    // 文件上传失败，显示上传出错。
    uploader.on('uploadError', function (file) {
       
    });

    // 完成上传完了，成功或者失败，先删除进度条。
    uploader.on('uploadComplete', function (file) {
       
    });

    function UpdataMyPWD()
    {
        var Dialog_ResetCodeObj= $.L.dialog({
            url: ACTION_URL("ResetCode", "Manager"),
            title: "重置密码",
            width: 800,
            height: 'auto',
            buttons: {
                "button_save": {
                    type: 'primary',
                    text: '保存',
                    click: function () {
                        var bootstrapValidator = $("#form_resetPWD").data('bootstrapValidator').validate();

                        if (bootstrapValidator.isValid()) {

                            $.L.ajaxHandle({
                                url: ACTION_URL("ResetUserPWD", "Manager"),
                                data: { id: "@_logonUser.UserID", newPwd: $("#newPwd").val() },
                                success: function (response) {
                                    if (response > 0) {
                                        $.L.msgSuccess("操作成功!");
                                        Dialog_ResetCodeObj.close();
                                
                                    }
                                    else {
                                        $.L.msgError("操作失败！");
                                    }
                                }
                            })
                        }
                        else {
                            $.L.msgError("请检查数据格式！");
                        };

                        //_this.Ajax_ResetUserPWD(id);
                    }
                },
                "button_cancel": {
                    type: 'default',
                    text: '取消',
                    click: 'MODALMISS'
                }
            }
        });
    }
   
</script>